<?php

/**
 * Subclass for representing a row from the 'sym_config' table.
 *
 * 
 *
 * @package lib.model
 */ 
class SymConfig extends BaseSymConfig
{
	public static function get($name)
	{
		$c = new Criteria();
		$c->add(SymConfigPeer::NAME, $name);
		$symConfig = SymConfigPeer::doSelectOne($c);
		if($symConfig)
		{
			return $symConfig;
		}else
		{
			return new SymConfig();
		}
	}
	
    public static function set($name, $value)
    {
        $symConfig = self::get($name);
        if(!$symConfig)
        {
        	$symConfig = new SymConfig();
        }
        $symConfig->setName($name);
        $symConfig->setValue($value);
        $symConfig->save();
    }
}
